// 来自 noipnoi
#include <bits/stdc++.h>
using namespace std;
const int lim = 1e7 + 1;
typedef long long ll;
ll X;
vector<ll> ans;
int main() {
  ios::sync_with_stdio(0);
  cin >> X;
  for (int c = -lim; c <= lim; ++c) {
    //(n+c)^2==n^2+n+X
    // 2cn+c^2==n+X
    // n=(X-c^2)/(2c-1)
    if ((X - 1ll * c * c) % (2 * c - 1) == 0)
      ans.push_back((X - 1ll * c * c) / (2 * c - 1));
  }
  sort(ans.begin(), ans.end());
  ans.erase(unique(ans.begin(), ans.end()), ans.end());
  cout << ans.size() << endl;
  for (auto x : ans)
    cout << x << ' ';
  cout << endl;
  return 0;
}